// MangerDB.cpp: implementation of the MangerDB class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "MangerDB.h"
#include "DBConnectionManager.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

using namespace DAWrapper;
MangerDB::MangerDB()
{

}

MangerDB::~MangerDB()
{

}

KnownStandardSet& MangerDB::GetStandardSet()
{
	_RecordsetPtr rs;
	
	CString strSql;
	strSql.Format(_T("select * from Standard"));
	try
	{
		_ConnectionPtr pConn = *DBConnectionManager::Instance()->GetConnectionPtrByUri(this->m_strPath);
		
		rs.CreateInstance(__uuidof(Recordset));
		rs->Open(_variant_t(strSql), (IDispatch*)(pConn),adOpenStatic,adLockOptimistic,adCmdText);

		this->m_StandardSet.SetRecordSet(rs);
		m_StandardSet.DBPath(m_strPath);
	}
	CATCH_COM_ERROR(rs, m_StandardSet)

	return m_StandardSet;
}